package org.fast.framework.annotation;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * 控制层方法注解
 */
@Target({ElementType.TYPE, ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
public @interface RequestMapping {

    // 请求路径
    String value();

    // 请求方式 GET、POST
    RequestMethod method() default RequestMethod.DEFAULT;

    enum RequestMethod {
        DEFAULT("DEFAULT"), GET("GET"), POST("POST");

        private String value;

        RequestMethod(String value) {
            this.value = value;
        }

        public String getValue() {
            return value;
        }
    }
}
